/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task08.task0812;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/* 
最长序列
*/

public class Solution {
    public static void main(String[] args) throws IOException {
        //在此编写你的代码
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(Integer.parseInt(reader.readLine()));
        }
        int sameNum = 1;
        int maxNum = 0;
        for (int i = 1; i < 10; i++) {
            if (list.get(i - 1).equals(list.get(i))) {
                sameNum++;
                if (maxNum < sameNum) {
                    maxNum = sameNum;
                }
            } else {
                if (maxNum < sameNum) {
                    maxNum = sameNum;
                }
                sameNum = 1;
            }
        }
        System.out.println(maxNum);
    }
}
